package com.xbb.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import com.xbb.mapper.ServicesCommentMapper;
import com.xbb.entity.ServicesComment;
import com.xbb.service.ServicesCommentService;
import org.springframework.stereotype.Service;

@Service
public class ServicesCommentServiceImpl implements ServicesCommentService {

    @Resource
    private ServicesCommentMapper servicesCommentMapper;

    // 删除数据
    @Override
    public int deleteByPrimaryKey(Integer id) {
        return servicesCommentMapper.deleteByPrimaryKey(id);
    }

    // 插入数据
    @Override
    public int insert(ServicesComment servicesComment) {
        return servicesCommentMapper.insert(servicesComment);
    }

    // 插入数据
    @Override
    public int insertSelective(ServicesComment servicesComment) {
        return servicesCommentMapper.insertSelective(servicesComment);
    }

    // 根据ID查询单个数据
    @Override
    public ServicesComment selectByPrimaryKey(Integer id) {
        return servicesCommentMapper.selectByPrimaryKey(id);
    }

    // 修改数据
    @Override
    public int updateByPrimaryKeySelective(ServicesComment servicesComment) {
        return servicesCommentMapper.updateByPrimaryKeySelective(servicesComment);
    }

    // 修改数据
    @Override
    public int updateByPrimaryKey(ServicesComment servicesComment) {
        return servicesCommentMapper.updateByPrimaryKey(servicesComment);
    }

    // 根据条件查询分页数据
    @Override
    public List<ServicesComment> selectListByPaging(Integer page, Integer limit, Integer servicesId, Integer userId, String content, String name, Integer staffId) {
        return servicesCommentMapper.selectListByPaging(
                (page - 1) * limit,
                limit,
                servicesId,
                userId,
                content,
                name,
                staffId
        );
    }

    // 根据条件查询数据条数
    @Override
    public int selectCountByPaging(Integer servicesId, Integer userId, String content, String name, Integer staffId) {
        return servicesCommentMapper.selectCountByPaging(
                servicesId,
                userId,
                content,
                name,
                staffId
        );
    }

    // 查询全部数据
    @Override
    public List<ServicesComment> selectAll() {
        return servicesCommentMapper.selectAll();
    }

    // 根据条件查询列表数据
    @Override
    public List<ServicesComment> selectList(ServicesComment servicesComment) {
        return servicesCommentMapper.selectList(servicesComment);
    }

    // 根据字段、排序方式、limit条 查询列表数据
    @Override
    public List<ServicesComment> selectListByLimit(String field, String sort, Integer limit) {
        return servicesCommentMapper.selectListByLimit(field, sort, limit);
    }

    // 根据字段查询列表数据
    @Override
    public List<ServicesComment> selectListByField(String field, Object value) {
        return servicesCommentMapper.selectListByField(field, value);
    }

    // 根据条件查询单个数据
    @Override
    public ServicesComment selectOne(ServicesComment servicesComment) {
        return servicesCommentMapper.selectOne(servicesComment);
    }

    // 根据ID查询详情数据
    @Override
    public ServicesComment selectOneByDetails(Integer id) {
        return servicesCommentMapper.selectOneByDetails(id);
    }

    // 查询全部条数
    @Override
    public int selectAllCount() {
        return servicesCommentMapper.selectAllCount();
    }

    // 根据条件查询数据条数
    @Override
    public int selectCount(ServicesComment servicesComment) {
        return servicesCommentMapper.selectCount(servicesComment);
    }

    // 根据条件修改全部数据
    @Override
    public int updateAll(ServicesComment servicesComment) {
        return servicesCommentMapper.updateAll(servicesComment);
    }


}
